package org.nanhill.moo;

import junit.framework.TestCase;

import org.hibernate.SessionFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;

public abstract class SpringSupportTestCase extends TestCase {

	protected static ApplicationContext ctx = null;

	protected static SessionFactory sf = null;

	static {
		String userDir = "";
		String[] paths = {
				userDir + "/src/main/webapp/WEB-INF/spring-service.xml",
				userDir + "/src/main/webapp/WEB-INF/spring-persist.xml",
				userDir + "/src/main/webapp/WEB-INF/spring-dao.xml",
				userDir + "/src/main/webapp/WEB-INF/spring-service.xml",
				userDir + "/src/main/webapp/WEB-INF/spring-config.xml" };
		ctx = new FileSystemXmlApplicationContext(paths);
		sf = (SessionFactory) ctx.getBean("sessionFactory");
	}

}
